home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
Projects
/
Examples
/
First Tutorial
/
Fiborock
next >
Wrap
Lisp/Scheme
|
1998-10-26
|
2KB
|
111 lines
; FIBOROCK
(setq sonal (activate-tonality
(pentatonic c 6) (blues1 f 6))
tonal (activate-tonality
(dorian c 4) (pentatonic b& 3))
chords (activate-tonality
(c min 7 1 4) (d& maj maj7 1 4))
)
(setq mel1 '(a b c d) ; bass
mel2 '(a d b c))
(setq solo1 (gen-random-keep 0.45 8 '(1 7) '(= a a a a a = a) '(b c d e)))
(setq solo2 (find-change (vector-to-symbol a g (gen-noise-white 30))))
(setq chd1 '(bcde); keyboard
chd2 '(a cd bde))
; make drums
(setq drms1 '(ah h dh ah h h dh i) ; hi-hat, snare, bass drum
drms2 '(h ch ch ah ah ic h ha)) ; hi-hat, rimshot, bass drum
; make some rhythms
(setq rhy1 (gen-loop '((1 4 2) (5 6 4) (1 6 3))
'(1/16 1/16 1/16 1/16 1/8 1/8))
rhy2 (gen-fibonacci 5 '(1/16 1/16 1/8) '(1/4 1/16 1/16 1/8)))
(setq rhyc '(1/2 1/1 1/2 1/2 1/2)
rhyd (gen-fibonacci 5 '(1/16 -1/16 1/8) '(1/16 1/8 1/16 1/4)))
; make melodies
(setq mel1a (fill-template rhy1 mel1)
mel2a (fill-template rhy2 mel2))
(setq drms1a (fill-template rhy1 drms1)
drms2a (fill-template rhy2 drms2))
(setq solo1a (fill-template rhy1 solo1)
solo2a (fill-template rhy2 solo2))
(setq chds1 (fill-template rhyc chd1)
chds2 (fill-template rhyd chd2))
(setq zone1 (list (make-zone rhy1))
zone2 (list (make-zone rhy2)))
(setq vel1 (fill-template rhy1 '(74 54 84 74 54 54 84 44))
vel2 (fill-template rhy2 '(64 94 127 84 74 84 64 117)))
; define virtual instruments
(def-symbol
solo (append solo1a solo2a)
bass (append mel1a mel2a)
piano (append chds1 chds2)
drums (append drms1a drms2a)
)
(def-length
solo (append rhy1 rhy2)
bass (append rhy1 rhy2)
piano (append rhyc rhyd)
drums (append rhy1 rhy2)
)
(def-velocity
drums (append vel1 vel2)
)
(def-zone
default (append zone1 zone2)
)
(def-tonality
solo sonal
bass tonal
piano chords
drums mt-32
)
(def-channel
solo 1
bass 3
piano 2
drums 10
)
(def-program gm-sound-set
solo blown-bottle
bass electric-bass-pick
piano acoustic-grand-piano
)
; save all into a MIDI file and play it
(def-tempo 120)
(midiport :printer)
(compile-instrument-p "ccl;output:" "quartet"
solo
bass
pno
drums
)